﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace CostaRicaPureTravelUtils.EmailConfiguration
{
    public class EmailContent
    {
        public enum EmailType 
        {
            CONTACT,
            SHOP,
            CUSTOMIZE_TRIPS
        }

        public const string SUBJECT_CONTACT = "Información de Contacto";
        public const string CUSTOMIZE_TRIP = "New Customized Trip";
        public const string SHOP_PRODUCTS = "Shop by Pacayitas Aliance";

        public static string getEmailTemplate(EmailType type, params string [] parameters) {
            string template = getTemplate(type);
            StringBuilder templateBuilder = new StringBuilder();
            templateBuilder.AppendFormat(template, parameters);
            return templateBuilder.ToString();
        }


        private static string getTemplate(EmailType type) 
        {
            string template = "";
            switch(type)
            {
                case EmailType.CONTACT:
                    template = EMAIL;
                    break;
                case EmailType.SHOP:
                    template = SHOP;
                    break;
                case EmailType.CUSTOMIZE_TRIPS:
                    template = CUSTOMIZE_TRIP_TMP;
                    break;
            }
            return template;
        }


        private static String EMAIL = "<strong>Contact Email</strong><br/>" +
            "<strong>Name:</strong> {0} <br/> " +
            "<strong>Phone:</strong> {1} <br/> " +
            "<strong>Who are you?:</strong> {2} <br/> " +
            "<strong>Is able to arrange:</strong> {3} <br/> " +
            "<strong>Message:</strong><br/> " +
            "{4}";

        private static String CUSTOMIZE_TRIP_TMP = "<strong>Customize Trip Email</strong><br/>" +
           "<strong>Name:</strong> {0} <br/> " +
           "<strong>Phone:</strong> {1} <br/> " +
           "<strong>Who are you?:</strong> {2} <br/> " +
           "<strong>Is able to arrange:</strong> {3} <br/> " +
           "<strong>Message:</strong><br/> " +
           "{4}<br/> " +
           "<strong>Trips:</strong><br/> " +
           "{5}";


        private static String SHOP = "<strong>SHOP</strong><br/>" +
           "<strong>Name:</strong> {0} <br/> " +
           "<strong>Phone:</strong> {1} <br/> " +
           "<strong>Message:</strong><br/> " +
           "{2}<br/> " +
           "<strong>Products:</strong><br/> " +
           "{3}";
    }
}
